package hn.cch.framework.log;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.helpers.MessageFormatter;

public class LogTest {

    private final static Logger logger = LoggerFactory.getLogger(LogTest.class);

    @Test
    public void testMessageFormatter() {
        System.out.println(MessageFormatter.format("a={}", "a").getMessage());
    }


    public void func(){
        throw null;
    }


    @Test
    public void test() {
        logger.info("start");
        try {
            func();
        }catch (Exception e){
            logger.info("info:{}", "asfd", e);
        }
    }



    @Test
    public void testError() {
        logger.info("start");
        try {
            func();
        }catch (Exception e){
            logger.error("info:{}", "asfd", e);
        }
    }


}
